-
-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid using util::function for thread function wrappers #3114
Conversation
inline threads::thread_result_type operator()(threads::thread_arg_type) | ||
{ | ||
// execute the actual thread function | ||
f(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be forwarded as well (same as https://github.com/STEllAR-GROUP/hpx/pull/3114/files#diff-f5e3956f6930a2fde1e87c0917f65d6bR799)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The forward has no effect here. It should rather be removed on the other spot. Good catch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, LGTM!
@sithhell how much of an improvement do you see from this change? |
19414ab
to
134b498
Compare
For a htts like scenario, with a granularity of 10 us, this is the speedup over current master:
For all other tested grain sizes, there is no noticable difference. |
134b498
to
ba9e815
Compare
Currently, the non-plain versions of the register_work/register_thread functions make use of util::function. This leads due unnecessary dynamic memory allocation since the potential for util::function using the small object optimization is limited.
ba9e815
to
93951d8
Compare
Currently, the non-plain versions of the register_work/register_thread functions
make use of util::function. This leads due unnecessary dynamic memory allocation
since the potential for util::function using the small object optimization is
limited.